<template>
    <div style="margin-top:50px;">
        <group label-width="7em" title="申请记录详情" >
          <cell title="课程名称：">{{roomlist.workName}}</cell>
          <cell title="作业名称：">{{roomlist.courseName}}</cell>
          <cell title="年份：">{{roomlist.year}}</cell>
          <cell title="学期：">{{roomlist.term  }}</cell>
          <cell title="开始使用时间：">{{roomlist.startTime}}</cell>
          <cell title="结束使用时间：">{{roomlist.endTime}}</cell>
          <cell title="联系电话：">{{roomlist.phone}}</cell>
          <cell title="申请时间：">{{roomlist.creattime}}</cell>
          <cell title="参与人数：">{{roomlist.member}}</cell>
          <cell title="申请状态：">{{roomlist.status===1?'待审核':roomlist.status===2?'通过':'驳回'}}</cell>
      </group><div v-transfer-dom>
      <loading :show="show1" text="加载中..."></loading>
    </div>
      <group label-width="7em" title="实验内容详情" v-for="(item1, index) in record" :key="index" > 
        <cell title="次数" >{{item1.number}}</cell>
        <cell title="使用的实验室" >{{item1.name}}</cell>
        <cell title="开始时间" >{{item1.startTime}}</cell>
        <cell title="结束时间" >{{item1.endTime}}</cell>
        <cell title="累计时间" >{{item1.createTime}}</cell>
        <x-textarea title="备注" readonly :rows="5" :value="item1.des"></x-textarea>
      </group>       
        
    </div>
</template>

<script>
import {Group, Cell, FormPreview, XTextarea, Loading, TransferDomDirective as TransferDom} from 'vux'

export default {
  directives: {
    TransferDom
  },
  components: {
    Group,
    XTextarea,
    Loading,
    Cell,
    FormPreview
  },
  created () {
    var i = this.$route.query.labid
    this.$http.get('/api/items/labApply/' + i).then((res) => {
      this.roomlist = {
        'id': res.data.content.id,
        'userId': res.data.content.userId,
        'courseName': res.data.content.courseName,
        'workName': res.data.content.workName,
        'member': res.data.content.member,
        'year': res.data.content.year,
        'term': res.data.content.term,
        'startTime': res.data.content.startTime,
        'endTime': res.data.content.endTime,
        'phone': res.data.content.phone,
        'status': res.data.content.status,
        'creatTime': res.data.content.creatTime,
        'updateTime': res.data.content.updateTime
      }
      this.record = res.data.content.labapplyrecordlist
      this.show1 = false
    })
  },
  data () {
    return {
      roomlist: {
        'id': '',
        'userId': '',
        'courseName': '',
        'workName': '',
        'member': '',
        'year': '',
        'term': '',
        'startTime': '',
        'endTime': '',
        'phone': '',
        'status': '',
        'creatTime': '',
        'updateTime': ''
      },
      record: [],
      show1: true
    }
  },
  methods: {
    onItemClick (index) {
    }
  }
}
</script>

<style>
    body{
        background-color: #eee;
    }
</style>
